<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      销售记录明细详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="编号：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="入账金额：">
          <span>{{formData.advance}}</span>
        </el-form-item>
        <el-form-item label="出账金额：">
          <span>{{formData.outs}}</span>
        </el-form-item>
        <el-form-item label="日期：">
          <span>{{formData.date}}</span>
        </el-form-item>
        <el-form-item label="实际入账：">
          <span>{{formData.actual_entry}}</span>
        </el-form-item>
        <el-form-item label="子订单id：">
          <span>{{formData.sub_order_id}}</span>
        </el-form-item>
        <el-form-item label="子订单号：">
          <span>{{formData.sub_order_num}}</span>
        </el-form-item>
        <el-form-item label="说明（下单，取消订单，售后退款）：">
          <span>{{formData.desc}}</span>
        </el-form-item>
        <el-form-item label="用户id：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="团长id：">
          <span>{{formData.superior_one_id}}</span>
        </el-form-item>
        <el-form-item label="汇总id，关联销售明细：">
          <span>{{formData.sale_id}}</span>
        </el-form-item>
        <el-form-item label="记录生成时间：">
          <span>{{formData.add_time}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  jbr_user_sales_records_detailInfo
} from '@/api/project/wmyh/project_wmyh_jbr_user_sales_records_detail'
export default {
  name: "a_wmyha_jbr_user_sales_records_detail_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        advance: 0.0, 
        outs: 0.0, 
        date: '2020/8/11 10:52:37', 
        actual_entry: 0.0, 
        sub_order_id: 0, 
        sub_order_num: '', 
        desc: '', 
        user_id: 0, 
        superior_one_id: 0, 
        sale_id: 0, 
        add_time: '2020/8/11 10:52:37', 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      jbr_user_sales_records_detailInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.advance = r.dataSingle.advance, 
        this.formData.outs = r.dataSingle.outs, 
        this.formData.date = r.dataSingle.date, 
        this.formData.actual_entry = r.dataSingle.actual_entry, 
        this.formData.sub_order_id = r.dataSingle.sub_order_id, 
        this.formData.sub_order_num = r.dataSingle.sub_order_num, 
        this.formData.desc = r.dataSingle.desc, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.superior_one_id = r.dataSingle.superior_one_id, 
        this.formData.sale_id = r.dataSingle.sale_id, 
        this.formData.add_time = r.dataSingle.add_time, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
